<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>设备详情</title>
    <link href="{{asset('/bst/css/bootstrap.min.css')}}" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
</head>
<body>

<div id="app" style="margin-top: 20px" class="container-fluid">

    <div>
        <div class="input-group mb-3">
            <input name="num" type="text" value="3" class="form-control" placeholder="请输入简答题的数量" aria-label="Recipient's username" aria-describedby="button-addon2">
            <div class="input-group-append">
                <button class="btn btn-primary" type="button" id="button">确定</button>
            </div>
        </div>
        <ul  class="list-group list-group_origin"></ul>
    </div>

    <div style="margin-top: 10px" >
        <div class="input-group mb-3">
            <input type="text"  disabled class="form-control"  aria-label="Recipient's username" aria-describedby="button-addon2">
            <div class="input-group-append">
                <button class="btn btn-primary" type="button" id="button1">昨天</button>
            </div>
        </div>
        <ul  class="list-group list-group1"></ul>
    </div>

    <div style="margin-top: 10px">
        <div class="input-group mb-3">
            <input type="text" disabled class="form-control"  aria-label="Recipient's username" aria-describedby="button-addon2">
            <div class="input-group-append">
                <button class="btn btn-primary" type="button" id="button2">前天</button>
            </div>
        </div>
        <ul  class="list-group list-group2"></ul>
    </div>


</div>

<script src="{{asset('common/js/jquery-3.4.1.min.js')}}" ></script>
<script>

    $("#button").click(function () {
        var num = $("input[name=num]").val()
        $.get("/api/wap/question?num="+num,function (res) {
            if(res.status){
                var html = ''
                res.data.records.forEach(function (item) {
                   html+= '<li class="list-group-item">'+item.content+'</li>'
                })
                $('.list-group_origin').append(html)
            }
        },'json')
    })

    $("#button1").click(function () {
        $.get("/api/wap/question?back=1",function (res) {
            if(res.status){
                var html = ''
                res.data.records.forEach(function (item) {
                   html+= '<li class="list-group-item">'+item.content+'</li>'
                })
                $('.list-group1').append(html)
            }
        },'json')
    })
    $("#button2").click(function () {
        $.get("/api/wap/question?back=2",function (res) {
            if(res.status){
                var html = ''
                res.data.records.forEach(function (item) {
                   html+= '<li class="list-group-item">'+item.content+'</li>'
                })
                $('.list-group2').append(html)
            }
        },'json')
    })

</script>


</body>
</html>
